home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Arashi 1.1 Source / SKSample / Squeezemain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-09  |  1.4 KB  |  80 lines  |  [TEXT/KAHL]

  1. /*/
  2.      Project Arashi/STORM: Squeezemain.c
  3.      Major release: 9/9/92
  4.  
  5.      Last modification: Wednesday, September 9, 1992, 21:46
  6.      Created: Saturday, October 6, 1990, 1:16
  7.  
  8.      Copyright © 1990-1992, Juri Munkki
  9. /*/
  10.  
  11. /*
  12. >>    This program is meant to illustrate how
  13. >>    the sound kit can be used. It also does
  14. >>    the packing phase.
  15. */
  16.  
  17. /*
  18. >>    Use the following two defines to control
  19. >>    what this program does. Ugly, but simple.
  20. */
  21.  
  22. #define    no_COMPRESS
  23. #define    no_DYNAMIC
  24.  
  25. #include "Shuddup.h"
  26.  
  27. /*        NOTE:
  28. >>
  29. >>            If you can find something funny about the
  30. >>            routine DoInits, please contact me immediately.
  31. >>            Your help will be appreciated.
  32. >>
  33. */
  34. void    main()
  35. {
  36.     int        i;
  37.     long    ticker;
  38.     Handle    filename;
  39.     
  40.     DoInits();
  41.  
  42.     filename = (Handle)GetString(128);
  43.     HLock(filename);
  44.     OpenResFile(*filename);
  45.  
  46. #ifdef    COMPRESS
  47.     SetPort(GetNewWindow(1000,0,(void *)-1));
  48.  
  49.     DoCompress();
  50. #else
  51.     ticker=TickCount();
  52.     InitSoundKit();
  53.     ticker=TickCount()-ticker;
  54.     SKVolume(8);
  55.  
  56. #ifndef DYNAMIC
  57.     for(i=0;i<NumSounds;i++)
  58.     {    PlayA(i,999-i);
  59.         while(!Button());
  60.         while(Button());
  61.     }
  62. #else    
  63.     {    Handle    thedata;
  64.  
  65.         /*    Load a sampled sound resource (SoundWave format)        */    
  66.         OpenResFile("\pDynamic Sample Resource");
  67.         thedata = GetResource('wave',128);
  68.         DetachResource(thedata);
  69.         SKProcessHandle(thedata);
  70.  
  71.         /*    Play the sampled sound resource.                        */
  72.         HLock(thedata);
  73.         SKPlayHandleA(thedata);
  74.         while(!Button());
  75.     }
  76. #endif
  77.     
  78.     CloseSoundKit();
  79. #endif
  80. }